DROP TABLE IF EXISTS jms_dm.dm_waybill_exception_detail_dt;
CREATE EXTERNAL TABLE jms_dm.dm_waybill_exception_detail_dt (
      network_code         string    COMMENT '网点编码'
     ,fran_code            string    COMMENT '加盟商编码'
     ,agent_code           string    COMMENT '代理区编码'
     ,sender_date          date      COMMENT '寄件时间(YYYY-MM-DD)'
     ,network_name         string    COMMENT '网点名称'
     ,fran_name            string    COMMENT '加盟商名称'
     ,agent_name           string    COMMENT '代理区名称'
     ,bill_code            string    COMMENT '运单号'
     ,exception_reason     string    COMMENT '异常原因'
     ,flag string
)
    COMMENT '电子面单异常明细表'
    PARTITIONED BY (dt string COMMENT '更新/创建日期 (yyyy-MM-dd)')
    STORED AS PARQUET
    LOCATION '/dw/hive/jms_dm.db/external/dm_waybill_exception_detail_dt'
    TBLPROPERTIES (
        'discover.partitions' = 'false',
        'parquet.column.index.access' = 'true'
        );

MSCK REPAIR TABLE jms_dm.dm_waybill_exception_detail_dt;